package net.guerlab.mall.seller.print.entity.order;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class OrderInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String orderSn;

    private String orderAmount;

    private String regionName;

    private String detailedAddress;

    private String mobilePhone;

    private String personnelName;
    
    private final List<GoodsInfo> goodsInfos = new ArrayList<GoodsInfo>();

    public final String getOrderSn() {
        return orderSn;
    }

    public final void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public final String getOrderAmount() {
        return orderAmount;
    }

    public final void setOrderAmount(String orderAmount) {
        this.orderAmount = orderAmount;
    }

    public final String getRegionName() {
        return regionName;
    }

    public final void setRegionName(String regionName) {
        this.regionName = regionName;
    }

    public final String getDetailedAddress() {
        return detailedAddress;
    }

    public final void setDetailedAddress(String detailedAddress) {
        this.detailedAddress = detailedAddress;
    }

    public final String getMobilePhone() {
        return mobilePhone;
    }

    public final void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public final String getPersonnelName() {
        return personnelName;
    }

    public final void setPersonnelName(String personnelName) {
        this.personnelName = personnelName;
    }

    @Override
    public String toString() {
        return "OrderInfo [orderSn=" + orderSn + ", orderAmount=" + orderAmount + ", regionName=" + regionName
                + ", detailedAddress=" + detailedAddress + ", mobilePhone=" + mobilePhone + ", personnelName="
                + personnelName + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((orderSn == null) ? 0 : orderSn.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        OrderInfo other = (OrderInfo) obj;
        if (orderSn == null) {
            if (other.orderSn != null) {
                return false;
            }
        } else if (!orderSn.equals(other.orderSn)) {
            return false;
        }
        return true;
    }

    public final void addGoodsInfos(GoodsInfo goodsInfo) {
        if (goodsInfo == null) {
            return;
        }
        
        goodsInfos.add(goodsInfo);
    }
    
    public final List<GoodsInfo> getGoodsInfos() {
        return goodsInfos;
    }
}
